﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>管理系统 - 管理中心</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- <meta ng-include="'head.html'"> -->
    <style type="text/css">
        .table>thead>tr>th{padding-bottom: 0px}
        .lineInfo { height:40px }
        .lineInfo>label{font-weight: 100 }
        .titleHead { font-family: 宋体; font-size: 16px; font-weight: 400; margin-left: 15px }
        .mt20{ margin-top: 20px }
        .mt40{ margin-top: 40px }
        .pHead{ color:#19B5FE }
        .content{ margin-left: 20px; font-size: 14px; font-family: arial; color:#1874CD; cursor: pointer; }
    </style>
    <link rel="stylesheet" type="text/css" href="../lib/css/footable.bootstrap.min.css">
    <script src="../lib/js/jquery.min.js" type="text/javascript"></script>
    <script src="../js/build.js" type="text/javascript"></script>
    <script src="../js/public.js" type="text/javascript"></script>
</head>
<body class="flat-blue">
<div class="app-container" ng-app="myApp" ng-controller="myCtrl">
<div class="row content-container">
<div ng-include="'menus.html'" onload="loadReady()"></div>
<div class="container-fluid">
<div class="side-body padding-top" id="main" style="padding-top:65px">
    <!------------------Main---------------->
    <div style="width:99%; margin:0px 10px 20px 10px; height:100%;
                            opacity:1;background-color:#fff; ">
        
        <!--基本信息-->
        <div class="panel panel-default" style="padding-left:0px">
            <div class="panel-heading pHead">
                公司信息
            </div>
            <div class="panel-body">
                <div>
                    <div class="col-md-6 lineInfo"><label>公司名</label><label class="content">{{cp.companyName}}</label></div>
                    <div class="col-md-6 lineInfo"><label>省份</label><label class="content">{{cp.province}}</label></div>
                </div>
                <div>
                    <div class="col-md-6 lineInfo"><label>城市</label><label class="content">{{cp.city}}</label></div>
                    <div class="col-md-6 lineInfo"><label>详细地址</label><label class="content">{{cp.address}}</label></div>
                </div>
                <div>
                    <div class="col-md-6 lineInfo">
                        <label>维护人</label>
                        <label class="content">
                            <a href="userInfo.html?u={{cp.editUser}}">{{cp.editUser}}</a>
                        </label>
                    </div>
                    <div class="col-md-6 lineInfo"><label>设备数量</label><label class="content">{{cp.count}}</label></div>
                </div>
            </div>
        </div>
        <div>
            <table class="table table-striped"></table>
        </div>
    </div>

    <!------------------End Main---------------------->
</div>  <!--End side-body-->
</div>  <!--End container-fluid-->
</div>  <!--End content-container-->
<div ng-include="'footer.html'"></div>
</div>  <!--End app-container-->

<script type="text/javascript" src="../lib/js/footable.min.js"></script>
<script language="javascript">
    var app = angular.module('myApp', []);
    
    app.controller('myCtrl', function($scope) {
        loadCtlBase($scope);
        $scope.cp = {
            companyName: getQueryString('cp'),
            province: getQueryString("pvn"),
        };

        loadCompany();

        function loadCompany(){
            ajaxData('get_company_info', $scope.cp, function(rst){
                var d = rst.data.company, lines = rst.data.lines;
                $scope.cp['count'] = lines.length;
                $scope.cp['province'] = d.province;
                $scope.cp['city'] = d.city;
                $scope.cp['address'] = d.address;
                $scope.cp['editUser'] = d.editUser;
                cout(rst);

                $scope.$apply();
                loadTable(lines);
            });
        }
    });

    function loadTable(data){
        var cols = [{'name':'industry', 'title':'行业'}, 
            {'name':'O', 'title':'氧'}, 
            {'name':'N', 'title':'氮'}, 
            {'name':'Ar', 'title':'氨'}, 
            {'name':'LO', 'title':'液氧'}, 
            {'name':'LN', 'title':'液氮'}, 
            {'name':'LAr', 'title':'液氨'}, 
            {'name':'producer', 'title':'设备商'},
            {'name':'project', 'title':'配套项目'},
            {'name':'mark', "breakpoints":"xs sm md", 'title':'备注'
                , 'style':{'width':'17%'}
            },
        ];
        var rows = [], keys = cols.map(function(d){ return d.name; });
        data.forEach(function(d){
            var row = {};
            keys.forEach(function(k){ row[k] = d[k]; });
            rows.push(row);;
        });

        $('.table').footable({
            "paging": { "enabled": true, 'size':10 },
            "sorting": { "enabled": true },
            "columns": cols,
            "rows": rows
        });

    }



</script>

</body>
</html>
